package capricornus.components.richtextfield
{
	import flash.display.Sprite;
	
	public class Face extends Sprite
	{
		private var _cmdData:String;
		/**
		 * 
		 * @param data 创建face命令字符串，以"|"分割，第一个是命令字类型
		 * 
		 */		
		public function Face( data:String )
		{
			super();
			_cmdData = data;
			init();
		}
		
		private function init():void
		{
			var arr:Array = _cmdData.split("|");
			var cmd:String = String(arr[0]);
			
			if( cmd==FaceType.COMMON )
			{
				graphics.beginFill( 0 );
				graphics.drawRect( 0, 0, 30, 20 );
				graphics.endFill();
			}
		}
		
		public function get cmdData():String
		{
			return _cmdData;
		}
		
		public static function getCommonFaceCMD( index:int ):String 
		{
			return FaceType.COMMON + "|" + index;
		}
	}
}